package chen;

public class SimpleAQS1 {
    //表示头元素
    private volatile Node head;
    //表示尾元素
    private volatile Node tail;
    //status为1表示锁被占用，0表示锁空闲
    private volatile int status;

    private static class Node {
        Node prev;//指向上一个元素
        Node next;//指向下一个元素
        Thread thread;//当前元素中的线程对象
        int status;//当前线程的状态
        // 定义几个状态常量
        static final int DEFAULT = 0;
        static final int WAIT = 1;
        static final int CANCELLED = -1;

        //准备几个构造方法
        public Node() {
        }

        public Node(Thread thread) {
            this.thread = thread;
        }

        public Node(Thread thread, int status) {
            this.thread = thread;
            this.status = status;
        }
    }
}
